//
//  NSTimer+Addition.h
//  GreenWheelCustomer
//
//  Created by zengweihuan on 2018/8/2.
//  Copyright © 2018年 FZHD. All rights reserved.
//

#import <Foundation/Foundation.h>
typedef void(^NSTimerBlock)(void);
@interface NSTimer (Addition)
/// 暂停
- (void)pause;
/// 恢复
- (void)resume;
/// 多少秒后恢复
- (void)resumeWithTimeInterval:(NSTimeInterval)time;
/**
 设置定时器

 @param interval 定时间隔
 @param repeats 是否重复
 @param callback 回调
 @return 返回定时器
 */
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval
                                repeats:(BOOL)repeats
                               timerCallback:(NSTimerBlock)callback;

/**
 设置定时器

 @param interval 定时间隔
 @param repeats 是否重复
 @param limitCount 超时次数
 @param timerCallback 回调
 @return 返回定时器
 */
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)interval
                                repeats:(BOOL)repeats
                             limitCount:(NSInteger)limitCount
                               timerCallback:(NSTimerBlock)timerCallback;
@end
